package lumis.portal.group.databaseviewmembership.formula;

import java.util.Map;

import lumis.util.query.IQueryFilter;
import lumis.util.query.QuerySelect;

/**
 * A formula statement, used to specify conditions for selecting the members
 * of a group. 
 *
 * @version $Revision: 10458 $ $Date: 2009-06-02 15:49:09 -0300 (Tue, 02 Jun 2009) $
 * @since 4.2.1
 */
public interface IFormulaStatement
{
	/**
	 * Verifies if a principal is the member of a group. 
	 * @param memberData the principal member data, according to the
	 * group and group type membership configurations.
	 * @return true if the principal is accepted as a member of the group
	 * according to this statement, false otherwise.
	 * @since 4.2.1
	 */
	public boolean accept(Map<String, Object> memberData);
	
	/**
	 * Returns a query filter that may be used to filter the principals
	 * that are accepted by this formula statement.
	 * @param select the select query.
	 * @return the query filter.
	 * @since 4.2.1
	 */
	public IQueryFilter getFilter(QuerySelect select);
}
